package com.usefullc.english.enums;


import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 字典类型
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum WordDictTypeEnum {


    WORD(0, "单词"),

    PHRASE(1, "短语"),

    IDIOM(2, "俚语"),


    ;


    private int code;
    private String value;

    WordDictTypeEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }


    public static WordDictTypeEnum getByCode(int code) {

        for (WordDictTypeEnum s : WordDictTypeEnum.values()) {
            if (s.getCode() == code) {
                return s;
            }
        }
        return null;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {


        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

}
